#!/usr/bin/php
<?php
include_once("common.php");

$request = get_news_request( 2 );

printf("len = %d\n", strlen( $request ) );
$sock = get_socket();
#$request = pack('NNN', 12, 0x00002000, 0x00000011 );

socket_write( $sock, $request, strlen($request) );
#socket_write( $sock, $request, 12 );
$buf = socket_read( $sock, 16 );
#printf("res = %d\n", $);
$arrRes = unpack( 'N*', $buf );
print_r( $arrRes );
if( $sock ) {
    socket_close( $sock );
}
?>
